package test.zdx.作业;


public class 类的测试
{

    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.dog_fun();
        System.out.println("1234");
        System.out.println(dog.anInt);
        System.out.println(dog.string);

    }

}

class Animal{
//    public String string = "This is a String !";
//    public  int anInt = 1024;此处private 意义何在?
//    private String string = "This is a String !";
//    private int anInt = 1024;
//    protected String string = "This is a String !";
//    protected int anInt = 1024;
     String string = "This is a String !";
     int anInt = 1024;
    public void eat(){
        System.out.println("All animals need to eat;");
        System.out.println("nbnb");
    }
}

class Dog extends Animal{
    public void dog_fun(){
        System.out.println("The dog is people^s friend");
    }
}
